package cn.com.duiba.millionaire.center.biz.dao;

import cn.com.duiba.millionaire.center.biz.entity.MillionaireWithdrawEntity;

import java.util.List;

/**
 * Created by xiaoxuda on 2018/1/31.
 */
public interface MillionaireWithdrawDao {

    long insert(MillionaireWithdrawEntity entity);

    MillionaireWithdrawEntity findById(long id);

    List<MillionaireWithdrawEntity> batchFindByConsumerId(long consumerId);

    Long countWithdrawAmount(Long consumerId);

    /**
     * 初始化到用户已扣款
     * @param id
     * @return
     */
    boolean update2UserPayed(long id);

    /**
     * 用户已扣款到开发者已扣款
     * @param id
     * @return
     */
    boolean update2DevPayed(long id);

    /**
     * 开发者已扣款到转账成功
     * @param id
     * @return
     */
    boolean update2Success(long id);

    /**
     * 非成功或者失败状态到失败状态
     * @param id
     * @return
     */
    boolean update2Fail(long id, String failMsg);

}
